package com.diamondfsd.jooq.methods;

import com.diamondfsd.jooq.learn.codegen.tables.records.S1UserRecord;
import org.jooq.DSLContext;

import static com.diamondfsd.jooq.learn.codegen.tables.TableS1User.S1_USER;

public class ChangeAndResetMethod {

  public static void changeMethod(DSLContext dslContext){
    S1UserRecord userRecord = dslContext.newRecord(S1_USER);
    userRecord.setId(1);
    userRecord.setUsername("username");
    userRecord.setEmail(null);
    userRecord.changed(S1_USER.EMAIL, false);
    userRecord.update();
  }

  public static void resetMethod(DSLContext dslContext){
    S1UserRecord userRecord = dslContext.newRecord(S1_USER);
    userRecord.setId(1);
    userRecord.setUsername("username");
    userRecord.setEmail(null);
    userRecord.reset(S1_USER.EMAIL);
    userRecord.update();
  }
}
